﻿/*
 * EnvironmentPersistablesBase
 * 
 * initial implementation : 28.5.2011
 *
 * Copyright (c) Adam Sida, asida@centrum.cz.
 * All rights reserved.
 * 
 * for license see Petra.Gis.License.txt
 */
using System;
using System.Collections.Generic;
//using System.Linq;
//using System.Text;
using System.Runtime.Serialization;
//using Petra.Gis.ImagingServices;

namespace Petra.Gis.Support
{

  /// <summary>
  /// manages environment settings, libraries, project settings and preferences,...
  /// </summary>
  [DataContract]
  public abstract class EnvironmentPersistablesBase
  {

    public EnvironmentPersistablesBase()
    {
      this.Libraries = new GisLibraries();
      this.Settings = new GisSettings();
      this.Components = new CustomComponents();
    }




    //[DataMember]
    //public Configuration Configuration
    //{ get; set; }




    //protected abstract GisSettings settings {get;set;}
    [DataMember]
    public GisSettings Settings
    { get; set; }





    //protected EnvironmentPersistablesBase _getInstance()
    //{
    //  return this;
    //}






    public EnvironmentPersistablesBase ParentPersistable
    { get; set; }






    //protected abstract EnvironmentPersistablesBase _getParent();
    //private EnvironmentPersistablesBase _getParent()
    //{

    //  //.net syntax stupidity, base cant be return val

    //  if (this.GetType() == typeof(ProjectEnvironmentPersistables))
    //    return (UserEnvironmentPersistables)this;
    //  else if (this.GetType() == typeof(UserEnvironmentPersistables))
    //    return (SystemEnvironmentPersistables)this;
    //  else
    //    return this;
    //}






    //protected abstract CustomComponents components { get; set; }
    [DataMember]
    public CustomComponents Components
    { get; set; }






    //protected abstract GisLibraries libraries { get; set; }
    [DataMember]
    public GisLibraries Libraries
    { get; set; }




  }

}
